<template>
	<view class="repair-wrap">
		<!-- <viewData :type="'noData'" :nextPage="!nextPage" :isTab="false" :isData="listData.length < 1" :loading="loading"
				  @onRefresh="onRefresh"> -->
				  
			<view>
				<view v-if="tableData.length == 0">
				  <view style="width: 232px;height: 242px;margin: 110px auto;">
				    <image style="width: 100%;height: 100%;" src="../../static/image/9015d0e9f45344c4007d408cd271f6a.png" mode=""></image>
				  </view>
				  <view style="width: 62%;margin: -66px auto;text-align: center;color: #999;">暂无数据</view>
				</view>
				<view v-for="(item,index) in tableData" @click="detail(item)">
					<view class="u-m-t-20 repair-box" style="padding: 15px 30px;" >
						<view class="repair-titel u-m-b-20">
							<view><h3>{{item.liti_name}}</h3></view>
						</view>
						<view style="float: right;margin-top: -32px;">
							<span v-if="item.case_state === 1" style="color: #FFB000">立案中</span>
							<span v-if="item.case_state === 2" style="color: red">审理中</span>
							<span v-if="item.case_state === 3" style="color: #14c169">已结案</span>
						</view>
						<view style="display: flex;color: #999999;margin-top: 15px;">
							<view>登记时间：</view>
							<view>{{item.submission_time}}</view>
						</view>
						
					</view>
				</view>
			</view>
			
		<!-- </viewData> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageIndex:1,
				loading: false,
				// type: 1,
				nextPage:false,
				listData:[],
				tableData:[],
			}
		},
		onShow() {
			this.checkLogin();
		},
		onPullDownRefresh() {
			this.homelist = uni.getStorageSync('hourseList')[uni.getStorageSync('hourseNum') || 0]
			this.getLitigation()
		},
		methods: {
			checkLogin(){
				let _this = this
				if (uni.getStorageSync('phone')) {
					if (uni.getStorageSync('loginFlag')) {
						if (!uni.getStorageSync('hourseList')) {
							// uni.showModal({
							// 	title: '请先进行业主认证',
							// 	showCancel: false,
							// 	confirmText: '确认',
							// 	confirmColor: '#F9A832',
							// 	success: function(res) {
							// 		if (res.confirm) {
							// 			_this.$Router.push({
							// 				path: '/pages/address/address'
							// 			})
							// 		}
							// 	}
							// });
							this.$openInvite()
						} else {
							_this.showFlag = true
							_this.homelist = uni.getStorageSync('hourseList')[uni.getStorageSync('hourseNum') || 0]
							_this.name = _this.homelist.proName;
							_this.address = _this.homelist.buildDistrictCode + '-' + _this.homelist.buildTowerCode + '-' + _this.homelist.roomUnitNumber +'-'+ _this.homelist.roomCode
							this.homelist = uni.getStorageSync('hourseList')[uni.getStorageSync('hourseNum') || 0]
							this.getLitigation()
						}
					} else {
						uni.showModal({
							title: '请先实名认证',
							showCancel: false,
							confirmText: '确认',
							confirmColor: '#F9A832',
							success: function(res) {
								if (res.confirm) {
									_this.$Router.push({
										path: '/pages/realName/realName'
									})
								}
							}
						});
					}
				} else {
					uni.showModal({
						title: '请先登录',
						showCancel: false,
						confirmText: '确认',
						confirmColor: '#F9A832',
						success: function(res) {
							if (res.confirm) {
								console.log('a')
								_this.$Router.pushTab({
									path: '/pages/user/user'
								})
							}
						}
					});
				}
			},
			getLitigation(){
				uni.showLoading({
					title:"加载中"
				})
				this.$request.api.getlitigation({
					pageIndex:this.pageIndex,
					// user_id:this.homelist.ownerId,
					room_id:this.homelist.roomId,
					theOwnerSide:1,
					case_state: 1
				}).then(res=>{
					this.tableData = res.data.data.datalist
					console.log(this.tableData)
					uni.hideLoading()
					uni.stopPullDownRefresh()
				})
			},
			detail(item) {

				let items = encodeURIComponent(JSON.stringify(item));
				uni.navigateTo({
					url: '/pages/user/litigation?item=' + items
				})
			}
			
		}
	}
</script>

<style lang="scss">
	.repair-wrap {
		width: 100%;
		min-height: 100vh;
		height: auto;
		background: #f4f4f4;
		overflow: hidden;

		.repair-box {
			background: #fff;

			.repair-titel {
				height: 44rpx;
				line-height: 44rpx;

				.repair-titel-l {
					float: left;
				}

				.repair-titel-r {
					float: right;
					color: #999;
				}
			}

			.repair-6 {
				color: #666;
			}
		}
		.button{
			width: 21%;
			border-radius: 33px;
			line-height: 26px;
			border: 1px solid #CCCCCC;
			font-size: 14px;
		}
		.header-form{
			// margin-top: 60rpx;
			background: #FFFFFF;
			.header-li{
				padding:0 55rpx;
				display: flex;
				// align-items: center;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				line-height: 95rpx;
				color: #333333;
				border-bottom:1rpx solid #EEEEEE;
				// padding: ;
				.header-name{
					width: 200rpx;
				}
				.text-area{
					width: 420rpx;
					padding-top: 26rpx;
					height: 60rpx;
				}
			}
		}
		.tab_nav{
			display: flex;
			justify-content: center;
			align-items: center;
		}
		.tab_nav  .navTitle {
			height: 90rpx;
			line-height: 90rpx;
			width: 100%;
			text-align: center;
			font-size: 32rpx;
			font-family: Alibaba PuHuiTi;
			color: #333;
		}
		.active {
			position: relative;
			color: #427705 ;
		}
		.active::after {
			content: "";
			position: absolute;
			width: 100rpx;
			height: 4rpx;
			background-color: #427705 ;
			left: 0px;
			right: 0px;
			bottom: 0px;
			margin: auto;
		}
		
	}
</style>
